<template>
  <div>
    <RoleList v-if="flag==1"></RoleList>
    <YhglByRole v-if="flag==2"></YhglByRole>
  </div>
</template>
<script>
import RoleList from "./roleList.vue";
import YhglByRole from "./yhglByRole.vue";
export default {
  components: { RoleList, YhglByRole },
  data() {
    return {
      flag: 1
    };
  },
  watch: {
    $route(to, from) {
      if (to.path.indexOf("jsgl") === -1) {
        return;
      }
      if (to.query && to.query.flag) {
        this.flag = to.query.flag;
      } else {
        this.flag = 1;
      }
    }
  },
  created() {
    if (this.$route.query && this.$route.query.flag !== undefined) {
      this.flag = this.$route.query.flag;
    }
  },
  mounted() {},
  methods: {}
};
</script>
<style  scoped lang="scss">
</style>
